package com.itheima.demo3generic;

public class GenericDemo {

    public static void main(String[] args){

        //手工包装：
        //Integer i = new Integer(100); //从jdk9 开始，Integer类被废弃，不再使用new关键字创建对象
        Integer j = Integer.valueOf(100);
        Integer k = Integer.valueOf(100);
        System.out.println(j == k); //true

        Integer l = Integer.valueOf(200);
        Integer m = Integer.valueOf(200);
        System.out.println(l == m); //false

        System.out.println("-------------------------");
        //自动包装：
        Integer n = 100;
        Integer o = 100;
        System.out.println(n == o);

        Integer p = 200;
        Integer q = 200;
        System.out.println(p == q);
        System.out.println("-------------------------");

        int ii = 23;
        String rs1 = Integer.toString(ii);
        System.out.println(rs1);
        System.out.println("-------------------------");

        String rs2 = "123";
        // Integer.valueOf(rs2);
        int jj = Integer.parseInt(rs2);
        System.out.println(jj);
        System.out.println("-------------------------");
    }
}
